package com.badlogicgames.superjumper;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.GLCommon;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.math.Vector3;

public class IntroAdScreen extends Screen {
	OrthographicCamera guiCam;
	SpriteBatch batcher;
	float stateTime;

	public IntroAdScreen(Game game) {
		super(game);
		guiCam = new OrthographicCamera(480, 320);
		batcher = new SpriteBatch();
		stateTime = 0.0f;
	}

	@Override
	public void update(float deltaTime) {
		// move to next screen after 2 seconds
		if (stateTime > 2) {
			game.setScreen(new IntroGameScreen(game));
		}
		stateTime = stateTime + deltaTime;

	}

	@Override
	public void present(float deltaTime) {
		// TODO Auto-generated method stub
		GLCommon gl = Gdx.gl;
		gl.glClearColor(1, 0, 0, 1);
		gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
		guiCam.update();
		batcher.setProjectionMatrix(guiCam.combined);

		batcher.disableBlending();
		batcher.begin();
		
		batcher.draw(Assets.adIntro,-480/2,-320/2, 480, 320);
		batcher.end();
	}

	@Override
	public void pause() {
		// TODO Auto-generated method stub

	}

	@Override
	public void resume() {
		// TODO Auto-generated method stub

	}

	@Override
	public void dispose() {
		// TODO Auto-generated method stub

	}

}